package learn.up.java.basic;

public class InnerDemo {
	public static void main(String[] args) {
	InnerDemo demo = new InnerDemo();
	demo.get();
	Inner iner = demo.new Inner();
	iner.get();
	
	//静态内部类对象
	StaticInner staticInn = new StaticInner();
	staticInn.show();
}
	void get() {
		System.out.println("outer");
	}
	
	private String name  ="Tom";

	private static String staticNmae = "Michael";
	private static int age  = 23;
	public class Inner{
		/**
		 * 成员内部类
		 */
		void get() {
			System.out.println("inner  "+InnerDemo.this.name);
			InnerDemo.this.get();
		}
		String name="HJOhn";
	}
	
	public static class  StaticInner {
		String staticNmae = "Jams";
		void show() {
			System.out.println("外部类静态同名属性： "+InnerDemo.staticNmae);
			System.out.printf("外部类不同名静态属性：%s  %n", age);
			System.out.printf("静态内部类同名属性：%s  %n", staticNmae);
		}
	}
}
